Here is another alternative to 'break' which improves code clarity when an unusual condition may arise during the loop:
too_big = 0;
while (i < 10 && !too_big)
{
if (position[i] <= 1000)
printf("Position is: %d\n",position[i++]);
else
too_big = 1;
}
The 'continue' statement is syntactically similar to 'break' but instead causes the next iteration of the loop to commence immediately. Again, in many cases code clarity can be improved by instead using appropriate conditional expressions.